package com.sw.test;

import org.junit.jupiter.api.Test;

import java.text.SimpleDateFormat;
import java.util.Date;

public class Uninx {
    @Test
    void Uninx() {
        //定义时间类型转换:
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        //获取从块里拿到的时间戳:
//        int time = ethBlock.getBlock().getTimestamp().intValue();
        long time = 1608687265 * 1000L;
        //转换时间戳为具体日期时间:
        String timestamp = sdf.format(new Date(time));
        System.out.println(timestamp);
    }
}
